

package com.gs.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 树节点，所有需要实现树节点的，都需要继承该类
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0
 */

@Data
@EqualsAndHashCode(callSuper=false)
public class TreeNode<T> extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 上级ID
     */
    private Long parentId;
    /**
     * 子节点列表
     */
    @TableField(exist = false)
    private List<T> children = new ArrayList<>();

}